<template>
  <div class="scope" @click="goMyDeviceList">
    <div v-if="!dList.length" class="title">未绑定设备</div>
    <div v-else class="title">已绑定设备</div>
    <div class="images">
      <img
        class="img"
        v-for="(item, i) in dList"
        :key="i"
        :src="getDeviceIcon(item)"
        alt=""
      />
    </div>
    <img style="width: 16px; height: 16px;" src="https://pics.leshiguang.com/vpage/2023/08/10/3247d7b148f24c5b8db7a108ed933a38.png" alt="">
  </div>
</template>

<script>

import {  getDeviceIcon } from '@/sg/index';

export default {
  components: {},
  props: {
    dList: {
      type: Array,
      default: () => []
    }
  },
  data() {
    return {
      devices: [
        
      ],
    };
  },
  created() {
    //查询推荐商品的列表
    this.loadData();
  },
  onShow() {
    console.warn('bindDevice')
  },
  methods: {
    getDeviceIcon,
    loadData() {},
    goMyDeviceList() {
      this.$basejs.globaltoken();
      if (global.token) {
        uni.navigateTo({
          url: "plugin-private://wxe3d2a6ab8dd5b49b/pages/device/mylist/index",
        });
      }
    },
  },
};
</script>
<style lang="scss" scoped>
.scope {
  display: flex;
  align-items: center;
  width: 100%;
  position: relative;
  padding: 20upx 40upx;
  z-index: 10;
  .title {
    color: #222;
    font-size: 14px;
    margin-right: 8px;
  }
  .images {
    display: flex;
    gap: 16upx;
    .img {
      width: 40upx;
      height: 40upx;
    }
  }
}
</style>
